//
//  FavCode.m
//  WangLottery
//
//  Created by leven hu on 12-4-22.
//  Copyright 2012年 __MyCompanyName__. All rights reserved.
//

#import "FavCode.h"

@implementation FavCode

@synthesize codeArray;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title=@"收藏夹";
    
}

- (void)initViewControl{

    

}

- (void)loadDataSource{
    
    NSMutableString *string=[[NSMutableString alloc]init];
    
    for (int i=0; i<[codeArray count]; i++) {
        
        [string appendFormat:@"%d,",[[codeArray objectAtIndex:i] intValue]+1];
        
    }
    
    lotteryNum.text=string;
    
    [string release];
  

}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (void)viewDidAppear:(BOOL)animated{

    [self loadDataSource];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}


#pragma userAction
// 收藏号码
- (IBAction)favCode{

    UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"收藏" message:@"已经添加到收藏夹" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
    
    [alert show];
    [alert release];

}


@end
